package com.xnyzc.lhy.common.penum.order;


/**
 * @Author: sunzheng
 * @Date: 2020-08-18
 * @Description:
 */
public enum CharteredOrderStatus {

    /**
     * 携程包车订单状态码
     */
    order(1, "已下单"),
    dispatch(2, "调度接单(预留)"),
    driverOrder(3, "已接单"),
    inOrder(4, "服务中"),
    orderSucccess(5, "服务完成"),
    cancelOrder(8, "已取消"),
    xcCancelOrder(10, "携程用户原因取消"),
    officeCancelOrder(20, "供应商原因取消");

    private Integer type;
    private String value;

    CharteredOrderStatus(Integer type, String value) {
        this.type = type;
        this.value = value;
    }

    public static CharteredOrderStatus findById(Integer type) {
        if (null == type) {
            return null;
        }
        CharteredOrderStatus[] values = CharteredOrderStatus.values();
        for (CharteredOrderStatus value : values) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return null;
    }


    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }

    public int getTypeInt() {
        return this.type;
    }
}
